home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / text+faqs / trekguide / trx / mv.rexx < prev    next >
OS/2 REXX Batch file  |  1996-02-26  |  2KB  |  76 lines

  1. /*  MARK, UNMARK, VIEW & WIPE SCRIPT FOR TREK-THE GUIDE v1.5
  2. **  v1.6 added non-specific node addressing and added rexxreq support */
  3.  
  4. if ~show('L','rexxarplib.library') then
  5.     call addlib('rexxarplib.library',0,-30)
  6.  
  7. arg title series func .
  8.  
  9. if func = "MARK" then do
  10.         open(tag, 'env:trekguide/'title, 'w')
  11.     writeln(tag, series)
  12.     close(tag)
  13.     result = PostMsg(180, 200,title'\IS NOW MARKED', TREKGUIDE)
  14.     call delay(30)
  15.     result = PostMsg() /* this closes the message requester */
  16.     end
  17.  
  18. if title = "VIEW" then do
  19.     eplist = FileList('ENV:TREKGUIDE/*', files, , N)
  20.         if eplist = 0 then do
  21.         envfiles = Request(180, 100, 'There are no marked files to view.\Try marking a file first.', , OKAY, ,TREKGUIDE)
  22.         exit
  23.         end
  24.  
  25.     pick = requestlist(1, files.0, files, 225, 250, 250, 100, TREKGUIDE, sort)
  26.     open(tag, 'env:trekguide/'pick, 'r')
  27.     linein = readln(tag)
  28.         if linein = TOS then linein = TG_ORIG
  29.         if linein = CAR then linein = TG_CARTOONS
  30.         if linein = TNG then linein = TG_TNG
  31.         if linein = DS9 then linein = TG_DS9        
  32.         if linein = VOY then linein = TG_VOYAGER
  33.         if linein = TMP then linein = TG_STMP
  34.     address amigaguide.1 link linein'/'pick
  35.     /* address showguide.1 LINK 'TG-ORIG/THE_NAKED_TIME */
  36.     end
  37.  
  38. if title = "CLEAR" then do   /* THIS IS THE WIPE COMMAND */
  39.  
  40.     eplist = FileList('ENV:TREKGUIDE/*', files, , N)
  41.  
  42.         if eplist ~= 0 then do
  43.         envfiles = Request(180, 250, 'Do you really want to\DELETE your marked files?', , YES,NO,TREKGUIDE)
  44.         end
  45.         if envfiles = '' then do
  46.         exit
  47.         end
  48.  
  49.         if eplist = 0 then do
  50.         envfiles = Request(180, 250, 'You have no marked files to delete.', , OKAY,,TREKGUIDE)
  51.         exit
  52.         end
  53.  
  54.     address command 'delete env:TrekGuide all'
  55.         address command 'delete envarc:TrekGuide all'
  56.  
  57.     call delay(30)
  58.     address command 'makedir env:TrekGuide'
  59.     exit
  60.     end
  61.  
  62. if series = "UNMARK" then do
  63.  
  64.     eplist = FileList('ENV:TREKGUIDE/'title, files, , N)
  65.         if eplist = 0 then do
  66.         envfiles = Request(180, 250, 'THIS EPISODE IS NOT MARKED.', , OKAY,,TREKGUIDE)
  67.         exit
  68.         end
  69.  
  70.         address command 'delete env:trekguide/'title
  71.     result = PostMsg(180, 200,title'\IS NOW UN-MARKED', TREKGUIDE)
  72.     call delay(40)
  73.     result = PostMsg() /* this closes the message requester */
  74.     exit
  75.     end
  76.